package net.butfly.bus.invoker;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class InvokerWrapper {
	private Object bean;
	private Method method;

	public InvokerWrapper(Object bean, Method method) {
		this.bean = bean;
		this.method = method;
	}

	public Object getBean() {
		return bean;
	}

	public Method getMethod() {
		return method;
	}

	public String toString() {
		return bean.getClass().getName() + ":" + method.toString();
	}

	public Object invoke(Object[] args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
		return method.invoke(bean, args);
	}
}
